<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/hexoblog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/hexoblog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/hexoblog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/hexoblog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/hexoblog/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<meta name="hexo-config" content="{&quot;hostname&quot;:&quot;robustqt.gitee.io&quot;,&quot;root&quot;:&quot;/hexoblog/&quot;,&quot;images&quot;:&quot;/hexoblog/images&quot;,&quot;scheme&quot;:&quot;Gemini&quot;,&quot;version&quot;:&quot;8.3.0&quot;,&quot;exturl&quot;:false,&quot;sidebar&quot;:{&quot;position&quot;:&quot;left&quot;,&quot;display&quot;:&quot;post&quot;,&quot;padding&quot;:18,&quot;offset&quot;:12},&quot;copycode&quot;:false,&quot;bookmark&quot;:{&quot;enable&quot;:false,&quot;color&quot;:&quot;#222&quot;,&quot;save&quot;:&quot;auto&quot;},&quot;fancybox&quot;:false,&quot;mediumzoom&quot;:false,&quot;lazyload&quot;:false,&quot;pangu&quot;:false,&quot;comments&quot;:{&quot;style&quot;:&quot;tabs&quot;,&quot;active&quot;:null,&quot;storage&quot;:true,&quot;lazyload&quot;:false,&quot;nav&quot;:null},&quot;motion&quot;:{&quot;enable&quot;:true,&quot;async&quot;:false,&quot;transition&quot;:{&quot;post_block&quot;:&quot;fadeIn&quot;,&quot;post_header&quot;:&quot;fadeInDown&quot;,&quot;post_body&quot;:&quot;fadeInDown&quot;,&quot;coll_header&quot;:&quot;fadeInLeft&quot;,&quot;sidebar&quot;:&quot;fadeInUp&quot;}},&quot;prism&quot;:false,&quot;i18n&quot;:{&quot;placeholder&quot;:&quot;搜索...&quot;,&quot;empty&quot;:&quot;没有找到任何搜索结果：${query}&quot;,&quot;hits_time&quot;:&quot;找到 ${hits} 个搜索结果（用时 ${time} 毫秒）&quot;,&quot;hits&quot;:&quot;找到 ${hits} 个搜索结果&quot;}}">
<meta name="description" content="博客搭建选择源 动态博客搭建 自己动手实现博客、后台 WordPress  静态博客搭建 静态博客的意思是，纯前端展示，用不到后台。简单高效，容易上手；   Hexo  Jekyll  Hugo 基于go语言实现的博客框架  VuePress 基于 Vue.js 实现的博客框架  Solo 基于Java实现的博客框架   Hexo 初步Hexo安装环境需求12Node.jsGit   Node.j">
<meta property="og:type" content="article">
<meta property="og:title" content="博客搭建">
<meta property="og:url" content="https://robustqt.gitee.io/2021/04/12/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/index.html">
<meta property="og:site_name" content="🎂MoveCake🙌">
<meta property="og:description" content="博客搭建选择源 动态博客搭建 自己动手实现博客、后台 WordPress  静态博客搭建 静态博客的意思是，纯前端展示，用不到后台。简单高效，容易上手；   Hexo  Jekyll  Hugo 基于go语言实现的博客框架  VuePress 基于 Vue.js 实现的博客框架  Solo 基于Java实现的博客框架   Hexo 初步Hexo安装环境需求12Node.jsGit   Node.j">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-04-12T03:43:11.391Z">
<meta property="article:modified_time" content="2021-04-12T02:40:41.898Z">
<meta property="article:author" content="是阿本">
<meta property="article:tag" content="Hexo博客入门搭建">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://robustqt.gitee.io/2021/04/12/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/">



<meta name="hexo-config-page" content="{&quot;sidebar&quot;:&quot;&quot;,&quot;isHome&quot;:false,&quot;isPost&quot;:true,&quot;lang&quot;:&quot;zh-CN&quot;}">
<meta name="hexo-config-calendar" content="">
<script data-pjax src="/hexoblog/js/load-config.js"></script>
  <title>博客搭建 | 🎂MoveCake🙌</title>
  




  <noscript>
    <link rel="stylesheet" href="/hexoblog/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/hexoblog/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">🎂MoveCake🙌</h1>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">记录点滴</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-home"><a href="/hexoblog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li>
        <li class="menu-item menu-item-tags"><a href="/hexoblog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">1</span></a></li>
        <li class="menu-item menu-item-categories"><a href="/hexoblog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">2</span></a></li>
        <li class="menu-item menu-item-archives"><a href="/hexoblog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">1</span></a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA%E9%80%89%E6%8B%A9"><span class="nav-number">1.</span> <span class="nav-text">博客搭建选择</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8A%A8%E6%80%81%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA"><span class="nav-number">1.1.</span> <span class="nav-text">动态博客搭建</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9D%99%E6%80%81%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA"><span class="nav-number">1.2.</span> <span class="nav-text">静态博客搭建</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Hexo-%E5%88%9D%E6%AD%A5"><span class="nav-number">2.</span> <span class="nav-text">Hexo 初步</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Hexo%E5%AE%89%E8%A3%85"><span class="nav-number">2.1.</span> <span class="nav-text">Hexo安装</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%8E%AF%E5%A2%83%E9%9C%80%E6%B1%82"><span class="nav-number">2.1.1.</span> <span class="nav-text">环境需求</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%AE%89%E8%A3%85-Hexo"><span class="nav-number">2.1.2.</span> <span class="nav-text">安装 Hexo</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Hexo-%E9%85%8D%E7%BD%AE"><span class="nav-number">2.2.</span> <span class="nav-text">Hexo 配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Hexo-%E9%83%A8%E7%BD%B2"><span class="nav-number">2.3.</span> <span class="nav-text">Hexo 部署</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Hexo-%E4%B8%BB%E9%A2%98%E7%BE%8E%E5%8C%96"><span class="nav-number">2.4.</span> <span class="nav-text">Hexo 主题美化</span></a></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">是阿本</p>
  <div class="site-description" itemprop="description">黑夜给了我黑色眼睛，可我用它去寻找光明！</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/hexoblog/archives/">
        
          <span class="site-state-item-count">1</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/hexoblog/categories/">
          
        <span class="site-state-item-count">2</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/hexoblog/tags/">
          
        <span class="site-state-item-count">1</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://robustqt.gitee.io/2021/04/12/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/hexoblog/images/avatar.gif">
      <meta itemprop="name" content="是阿本">
      <meta itemprop="description" content="黑夜给了我黑色眼睛，可我用它去寻找光明！">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="🎂MoveCake🙌">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          博客搭建
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>
      

      <time title="创建时间：2021-04-12 11:43:11 / 修改时间：10:40:41" itemprop="dateCreated datePublished" datetime="2021-04-12T11:43:11+08:00">2021-04-12</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/hexoblog/categories/Hexo/" itemprop="url" rel="index"><span itemprop="name">Hexo</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/hexoblog/categories/Hexo/Hexo-%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" itemprop="url" rel="index"><span itemprop="name">Hexo 博客搭建</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h2 id="博客搭建选择"><a href="#博客搭建选择" class="headerlink" title="博客搭建选择"></a>博客搭建选择</h2><p><a href="www.codesheep.cn">源</a></p>
<h3 id="动态博客搭建"><a href="#动态博客搭建" class="headerlink" title="动态博客搭建"></a>动态博客搭建</h3><ul>
<li>自己动手实现博客、后台</li>
<li>WordPress</li>
</ul>
<h3 id="静态博客搭建"><a href="#静态博客搭建" class="headerlink" title="静态博客搭建"></a>静态博客搭建</h3><blockquote>
<p>静态博客的意思是，纯前端展示，用不到后台。简单高效，容易上手；</p>
</blockquote>
<ul>
<li><p>Hexo</p>
</li>
<li><p>Jekyll</p>
</li>
<li><p>Hugo</p>
<p>基于go语言实现的博客框架</p>
</li>
<li><p>VuePress</p>
<p>基于 Vue.js 实现的博客框架</p>
</li>
<li><p>Solo</p>
<p>基于Java实现的博客框架</p>
</li>
</ul>
<h2 id="Hexo-初步"><a href="#Hexo-初步" class="headerlink" title="Hexo 初步"></a>Hexo 初步</h2><h3 id="Hexo安装"><a href="#Hexo安装" class="headerlink" title="Hexo安装"></a>Hexo安装</h3><h4 id="环境需求"><a href="#环境需求" class="headerlink" title="环境需求"></a>环境需求</h4><figure class="highlight txt"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Node.js</span><br><span class="line">Git</span><br></pre></td></tr></table></figure>

<ul>
<li><p>Node.js</p>
<p>使用 <code>node -v</code>  <code>npm -v</code> 验证是否安装成功；</p>
</li>
<li><p>安装 cnpm</p>
<p>npm 是国外的，安装 Hexo 比较慢，所以换成 cnpm：</p>
<p><code>npm i -g cnpm --registry=https://registry.npm.taobao.org</code></p>
</li>
</ul>
<h4 id="安装-Hexo"><a href="#安装-Hexo" class="headerlink" title="安装 Hexo"></a>安装 Hexo</h4><ul>
<li><p>使用 cnpm 安装 Hexo</p>
<p><code>cnpm i -g hexo-cli</code>；</p>
<p>验证：<code>hexo -v</code></p>
</li>
</ul>
<h3 id="Hexo-配置"><a href="#Hexo-配置" class="headerlink" title="Hexo 配置"></a>Hexo 配置</h3><ol>
<li><p>新建一个空文件用于存放博客相关文件</p>
<p>本机下新建<code>E:\Project\HexoBlog</code>  文件夹</p>
<p><strong>ps:</strong> 但凡博客出错无法解决，只要删除重来即可</p>
</li>
<li><p><code>hexo init</code></p>
<p>生成 Hexo 博客相关文件；</p>
<p>可以发现新建的空文件多了一大堆东西；</p>
<p><strong>本地验证:</strong> <code>hexo s</code>  验证是否能本地运行</p>
</li>
<li><p>添加个人博客文件</p>
<p>在 <code>E:\Project\HexoBlog\source\_posts</code> 文件夹下添加个人的 <code>markdown</code> 文件；</p>
</li>
<li><p><code>hexo g</code></p>
<p>刷新一下博客，将上一步放进来的文件刷新到博客中去。</p>
<p><strong>ps</strong>：每次对博客修改，都应当 <code>hexo c</code>、<code>hexo g</code> 使修改生效</p>
<p><strong>验证</strong>：<code>hexo s</code> ,本地验证是否可行</p>
</li>
</ol>
<h3 id="Hexo-部署"><a href="#Hexo-部署" class="headerlink" title="Hexo 部署"></a>Hexo 部署</h3><blockquote>
<p>本地创建成功，部署到服务器上，方便随时随地访问</p>
</blockquote>
<ol>
<li><p>登录 <code>Github</code> ，新建仓库</p>
<p><strong>注意：</strong> 仓库名必须为 <code>github用户名.github.io</code></p>
</li>
<li><p>安装插件</p>
<p>将博客部署到 Github的插件：<code>cnpm i --save hexo-deployer-git</code></p>
</li>
<li><p>修改 配置文件 <code>_config.yml</code></p>
<p><strong>注意</strong>：部署之前</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.email “1667582502@qq.com”</span><br><span class="line"></span><br><span class="line">git config --global user.name “kailebee”</span><br></pre></td></tr></table></figure>



<p>将博客托管到 Github 平台：</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># 在 deploy 节点下</span><br><span class="line">deploy:</span><br><span class="line">  type: git</span><br><span class="line">  repo: https://github.com/kailebee/kailebee.github.io.git</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>

<p><strong>验证：</strong> <code>https://kailebee.github.io/</code></p>
</li>
</ol>
<h3 id="Hexo-主题美化"><a href="#Hexo-主题美化" class="headerlink" title="Hexo 主题美化"></a>Hexo 主题美化</h3><ul>
<li><p>更换主题</p>
<p><strong>下载主题:</strong> <code>git clone https://github.com/theme-next/hexo-theme-next themes/next</code></p>
<p><strong>更改站点配置文件</strong> <code>_config.yml</code>：<code>theme:next</code></p>
<p><strong>更换主题的四种风格</strong>：</p>
<p>主题配置文件：<code>scheme：Gemini</code></p>
</li>
<li><p>Next 主题一般配置</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">override：false #表示是否将主题置为默认样式</span><br><span class="line">cache:</span><br><span class="line">	enable:true #表示添加缓存功能，这样浏览器后续打开我们的博客网站会更快</span><br><span class="line">menu: #设置博客各个页面的相对路径，默认根路径是blog&#x2F;source</span><br><span class="line">  home: &#x2F; || home</span><br><span class="line">  about: &#x2F;about&#x2F; || user</span><br><span class="line">  tags: &#x2F;tags&#x2F; || tags</span><br><span class="line">  categories: &#x2F;categories&#x2F; || th</span><br><span class="line">  archives: &#x2F;archives&#x2F; || archive</span><br><span class="line">  #schedule: &#x2F;schedule&#x2F; || calendar #日历</span><br><span class="line">  #sitemap: &#x2F;sitemap.xml || sitemap #站点地图，供搜索引擎爬取</span><br><span class="line">  #commonweal: &#x2F;404&#x2F; || heartbeat # 腾讯公益404</span><br><span class="line"></span><br><span class="line"># Enable&#x2F;Disable menu icons &#x2F; item badges.</span><br><span class="line">menu_settings:</span><br><span class="line">  icons: true # 是否显示各个页面的图标</span><br><span class="line">  badges: true # 是否显示分类&#x2F;标签&#x2F;归档页的内容量</span><br><span class="line"># Schemes</span><br><span class="line">scheme: Gemini</span><br></pre></td></tr></table></figure></li>
<li><p>站点文件基本配置 <code>blog/_config.yml</code> </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br></pre></td><td class="code"><pre><span class="line">title: 见渊の博客</span><br><span class="line">subtitle: 记录生活中的点点滴滴</span><br><span class="line">description: 直到这一刻微笑着说话为止，我至少留下了一公升眼泪</span><br><span class="line">keywords:</span><br><span class="line">author: 黄飘</span><br><span class="line">language: zh-CN # 主题语言</span><br><span class="line">timezone: Asia&#x2F;Shanghai #中国的时区，不要乱改城市</span><br><span class="line"></span><br><span class="line"># URL</span><br><span class="line">## If your site is put in a subdirectory, set url as &#39;http:&#x2F;&#x2F;yoursite.com&#x2F;child&#39; and root as &#39;&#x2F;child&#x2F;&#39;</span><br><span class="line">url: https:&#x2F;&#x2F;huangpiao.tech #绑定域名</span><br><span class="line">root: &#x2F;  #默认根路径，指向实际的source</span><br><span class="line">permalink: :year&#x2F;:month&#x2F;:day&#x2F;:title&#x2F;</span><br><span class="line">permalink_defaults:</span><br><span class="line"></span><br><span class="line"># Directory</span><br><span class="line">source_dir: source</span><br><span class="line">public_dir: public</span><br><span class="line">tag_dir: tags</span><br><span class="line">archive_dir: archives</span><br><span class="line">category_dir: categories</span><br><span class="line">code_dir: downloads&#x2F;code</span><br><span class="line">i18n_dir: :lang</span><br><span class="line">skip_render: README.md # 部署的时候不包含的文件</span><br><span class="line"></span><br><span class="line"># Writing</span><br><span class="line">new_post_name: :title.md # 默认的新博文名称</span><br><span class="line">default_layout: post # 默认布局</span><br><span class="line">titlecase: false # Transform title into titlecase</span><br><span class="line">external_link: true # Open external links in new tab</span><br><span class="line">filename_case: 0 #把博客名称改成小写&#x2F;大写（1,2）</span><br><span class="line">render_drafts: false # 是否显示草稿</span><br><span class="line">post_asset_folder: false #是否启用资源文件夹（用来存放相对路径图片或文件）</span><br><span class="line">relative_link: false # 把链接改为与根目录的相对位址</span><br><span class="line">future: true</span><br><span class="line">highlight:</span><br><span class="line">  enable: true #是否开启代码高亮</span><br><span class="line">  line_number: true #是否增加代码行号</span><br><span class="line">  auto_detect: true #自动判断代码语言</span><br><span class="line">  tab_replace:</span><br><span class="line">  </span><br><span class="line"># Home page setting</span><br><span class="line"># path: Root path for your blogs index page. (default &#x3D; &#39;&#39;)</span><br><span class="line"># per_page: Posts displayed per page. (0 &#x3D; disable pagination)</span><br><span class="line"># order_by: Posts order. (Order by date descending by default)</span><br><span class="line">index_generator: #首页博客分布</span><br><span class="line">  path: &#39;&#39; #博客的默认路径</span><br><span class="line">  per_page: 10 #每页博客数量上限</span><br><span class="line">  order_by: -date #博客排序</span><br><span class="line"></span><br><span class="line"># Date &#x2F; Time format</span><br><span class="line">## Hexo uses Moment.js to parse and display date</span><br><span class="line">## You can customize the date format as defined in</span><br><span class="line">## http:&#x2F;&#x2F;momentjs.com&#x2F;docs&#x2F;#&#x2F;displaying&#x2F;format&#x2F;</span><br><span class="line">date_format: YYYY-MM-DD #博客日期格式</span><br><span class="line">time_format: HH:mm:ss #博客时间格式</span><br><span class="line"></span><br><span class="line"># Pagination</span><br><span class="line">## Set per_page to 0 to disable pagination</span><br><span class="line">per_page: 10 #同上</span><br><span class="line"></span><br><span class="line">#归档页的分页设置</span><br><span class="line">archive_generator: #归档页的配置</span><br><span class="line">  per_page: 30 #归档页每页博客数</span><br><span class="line">  yearly: true #按年归档</span><br><span class="line">  monthly: true #按月归档</span><br><span class="line">#标签页的分页设置</span><br><span class="line">tag_generator:</span><br><span class="line">  per_page: 20 #标签页每页博客数</span><br><span class="line">  </span><br><span class="line">theme: next6 #选择博客主题，名字为themes中选择的主题文件夹名称</span><br><span class="line"></span><br><span class="line"># Deployment</span><br><span class="line">## Docs: https:&#x2F;&#x2F;hexo.io&#x2F;docs&#x2F;deployment.html</span><br><span class="line">deploy: #博客部署</span><br><span class="line">  type: git</span><br><span class="line">  repo: </span><br><span class="line">    github: https:&#x2F;&#x2F;github.com&#x2F;nightmaredimple&#x2F;nightmaredimple.github.io.git</span><br><span class="line">    coding: https:&#x2F;&#x2F;git.coding.net&#x2F;nightmaredimple&#x2F;nightmaredimple.git</span><br><span class="line">  branch: master</span><br><span class="line"></span><br></pre></td></tr></table></figure></li>
<li><p>添加博客自定义图标</p>
<p>将制作好的<code>16*16.png</code> <code>32*32.png</code> 等放在 <code>blog/themes/next/sources/images</code> 目录下 ，并修改主题配置文件：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">favicon:</span><br><span class="line">  small: &#x2F;images&#x2F;16x16.png</span><br><span class="line">  medium: &#x2F;images&#x2F;32x32.png</span><br><span class="line">  apple_touch_icon: &#x2F;images&#x2F;128x128.png</span><br><span class="line">  safari_pinned_tab: &#x2F;images&#x2F;logo2.svg</span><br></pre></td></tr></table></figure></li>
<li><p>鼠标点击特效 </p>
<p><strong>红心</strong></p>
<p><code>themes/next/source/js</code> 下添加 <code>clicklove.js</code></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">!<span class="function"><span class="keyword">function</span>(<span class="params">e,t,a</span>)</span>&#123;<span class="function"><span class="keyword">function</span> <span class="title">n</span>(<span class="params"></span>)</span>&#123;c(<span class="string">&quot;.heart&#123;width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);&#125;.heart:after,.heart:before&#123;content: &#x27;&#x27;;width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;&#125;.heart:after&#123;top: -5px;&#125;.heart:before&#123;left: -5px;&#125;&quot;</span>),o(),r()&#125;<span class="function"><span class="keyword">function</span> <span class="title">r</span>(<span class="params"></span>)</span>&#123;<span class="keyword">for</span>(<span class="keyword">var</span> e=<span class="number">0</span>;e&lt;d.length;e++)d[e].alpha&lt;=<span class="number">0</span>?(t.body.removeChild(d[e].el),d.splice(e,<span class="number">1</span>)):(d[e].y--,d[e].scale+=<span class="number">.004</span>,d[e].alpha-=<span class="number">.013</span>,d[e].el.style.cssText=<span class="string">&quot;left:&quot;</span>+d[e].x+<span class="string">&quot;px;top:&quot;</span>+d[e].y+<span class="string">&quot;px;opacity:&quot;</span>+d[e].alpha+<span class="string">&quot;;transform:scale(&quot;</span>+d[e].scale+<span class="string">&quot;,&quot;</span>+d[e].scale+<span class="string">&quot;) rotate(45deg);background:&quot;</span>+d[e].color+<span class="string">&quot;;z-index:99999&quot;</span>);requestAnimationFrame(r)&#125;<span class="function"><span class="keyword">function</span> <span class="title">o</span>(<span class="params"></span>)</span>&#123;<span class="keyword">var</span> t=<span class="string">&quot;function&quot;</span>==<span class="keyword">typeof</span> e.onclick&amp;&amp;e.onclick;e.onclick=<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;t&amp;&amp;t(),i(e)&#125;&#125;<span class="function"><span class="keyword">function</span> <span class="title">i</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">var</span> a=t.createElement(<span class="string">&quot;div&quot;</span>);a.className=<span class="string">&quot;heart&quot;</span>,d.push(&#123;<span class="attr">el</span>:a,<span class="attr">x</span>:e.clientX-<span class="number">5</span>,<span class="attr">y</span>:e.clientY-<span class="number">5</span>,<span class="attr">scale</span>:<span class="number">1</span>,<span class="attr">alpha</span>:<span class="number">1</span>,<span class="attr">color</span>:s()&#125;),t.body.appendChild(a)&#125;<span class="function"><span class="keyword">function</span> <span class="title">c</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">var</span> a=t.createElement(<span class="string">&quot;style&quot;</span>);a.type=<span class="string">&quot;text/css&quot;</span>;<span class="keyword">try</span>&#123;a.appendChild(t.createTextNode(e))&#125;<span class="keyword">catch</span>(t)&#123;a.styleSheet.cssText=e&#125;t.getElementsByTagName(<span class="string">&quot;head&quot;</span>)[<span class="number">0</span>].appendChild(a)&#125;<span class="function"><span class="keyword">function</span> <span class="title">s</span>(<span class="params"></span>)</span>&#123;<span class="keyword">return</span><span class="string">&quot;rgb(&quot;</span>+~~(<span class="number">255</span>*<span class="built_in">Math</span>.random())+<span class="string">&quot;,&quot;</span>+~~(<span class="number">255</span>*<span class="built_in">Math</span>.random())+<span class="string">&quot;,&quot;</span>+~~(<span class="number">255</span>*<span class="built_in">Math</span>.random())+<span class="string">&quot;)&quot;</span>&#125;<span class="keyword">var</span> d=[];e.requestAnimationFrame=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;<span class="keyword">return</span> e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;<span class="built_in">setTimeout</span>(e,<span class="number">1e3</span>/<span class="number">60</span>)&#125;&#125;(),n()&#125;(<span class="built_in">window</span>,<span class="built_in">document</span>);</span><br></pre></td></tr></table></figure>

<p>在<code>\themes\next\layout\_layout.swig</code>文件末尾添加:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&lt;!-- 页面点击小红心 --&gt;</span><br><span class="line">&lt;script type&#x3D;&quot;text&#x2F;javascript&quot; src&#x3D;&quot;&#x2F;js&#x2F;src&#x2F;clicklove.js&quot;&gt;&lt;&#x2F;script&gt;</span><br></pre></td></tr></table></figure></li>
<li></li>
</ul>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/hexoblog/tags/Hexo%E5%8D%9A%E5%AE%A2%E5%85%A5%E9%97%A8%E6%90%AD%E5%BB%BA/" rel="tag"># Hexo博客入门搭建</a>
          </div>

        

    </footer>
  </article>
</div>





<script src="/hexoblog/js/comments.js"></script>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">是阿本</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<script src="/hexoblog/js/utils.js"></script><script src="/hexoblog/js/motion.js"></script><script src="/hexoblog/js/next-boot.js"></script>

  






  





</body>
</html>
